package com.ruoyi.bizsys.service.impl;

import java.util.List;
import java.util.Arrays;
                                        import org.springframework.stereotype.Service;
    import com.ruoyi.bizsys.mapper.ApplyContactsBindMapper;
import com.ruoyi.bizsys.domain.ApplyContactsBind;
import com.ruoyi.bizsys.service.IApplyContactsBindService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;


/**
 * 用户通讯录关联Service业务层处理
 *
 * @author african-loan
 * @date 2021-12-30
 */
@Service
public class ApplyContactsBindServiceImpl extends ServiceImpl<ApplyContactsBindMapper,ApplyContactsBind> implements IApplyContactsBindService {

    /**
     * 查询用户通讯录关联
     *
     * @param id 用户通讯录关联ID
     * @return 用户通讯录关联
     */
    @Override
    public ApplyContactsBind selectApplyContactsBindById(Long id) {
        return this.getById(id);
    }

    /**
     * 查询用户通讯录关联列表
     *
     * @param applyContactsBind 用户通讯录关联
     * @return 用户通讯录关联
     */
    @Override
    public List<ApplyContactsBind> selectApplyContactsBindList(ApplyContactsBind applyContactsBind) {
        return this.list(new QueryWrapper<>(applyContactsBind).last("order by id desc"));
    }

    /**
     * 新增用户通讯录关联
     *
     * @param applyContactsBind 用户通讯录关联
     * @return 结果
     */
            @Override
    public int insertApplyContactsBind(ApplyContactsBind applyContactsBind) {
                                                                            return baseMapper.insert(applyContactsBind);
    }

    /**
     * 修改用户通讯录关联
     *
     * @param applyContactsBind 用户通讯录关联
     * @return 结果
     */
            @Override
    public int updateApplyContactsBind(ApplyContactsBind applyContactsBind) {
                                                                            return baseMapper.updateById(applyContactsBind);
    }

    /**
     * 批量删除用户通讯录关联
     *
     * @param ids 需要删除的用户通讯录关联ID
     * @return 结果
     */
            @Override
    public int deleteApplyContactsBindByIds(Long[] ids) {
        return baseMapper.deleteBatchIds(Arrays.asList(ids));
    }

    /**
     * 删除用户通讯录关联信息
     *
     * @param id 用户通讯录关联ID
     * @return 结果
     */
    @Override
    public int deleteApplyContactsBindById(Long id) {
        return baseMapper.deleteById(id);
    }

}
